/**
 * 右侧内容组件
 */
import React from 'react';
import { Space } from 'antd';
import { useModel } from '@umijs/max';
import Avatar from './AvatarDropdown';

const GlobalHeaderRight: React.FC = () => {
  const { initialState } = useModel('@@initialState');

  if (!initialState || !initialState.settings) {
    return null;
  }

  const { currentUser } = initialState;

  return (
    <Space>
      {currentUser && <Avatar />}
    </Space>
  );
};

export default GlobalHeaderRight;
